Hello and welcome back to the
next module of this course, which is loop activities. In the previous module, you understood if and switch activities that fall under the decision based control flow, and the difference between
if and switch activities. By the end of this module, you will be able to understand loop activities and their types, the do While and while activity, and the for each activity. In this video you will
understand loops and its types, so let's get started. A loop is a
programming structure that repeats a sequence of instructions until a
specific condition is met or till the
condition is valid. Suppose a user wants to create a program that counts from 1-10. Once the counting ends at 10, the user may want to restart the counting again from 1-10. This is an example of a loop. The user can define the number of times
the loop should run. In this example,
count from 1-10 is the instruction
and the number of times the loop should
run is the condition. As long as the condition is
met, the count continues. Let's now take a look at the different types
of loop activities. In studio they are do while, while and for each. Let us now understand
each in detail. Do while activity executes the contained activities first and then checks if the
condition is true. This also means that a do while activity will be
executed at least once, even if the condition
is not true. While activity executes
the contained activities. While the provided
condition is true, it checks the condition at the beginning before
getting into the loop. If the condition is not true, the loop doesn't start. For each activity iterates through the elements
of lists, arrays, data sets, etc, and performs an action on
each element individually. Now is the time to get into the details of these
loop activities. The next video we'll explain the do while activity.
Thanks for watching.